@extends('layouts.mobile')

@section('title', '绑定客服')

@section('content')
<div class="kefu">
    <div class="logo">
        <div class="image bg-cover" style="background-image: url({{image_url($shop['logo'])}})"></div>
    </div>
    <div class="shop-name">{{$shop['shop_name']}}</div>

    @if ($kefu)
        <div class="tips">你已成为该店客服人员</div>
    @else
        <div class="tips">点击确认按钮成为该店铺的客服人员</div>

        <div class="button" id="bind">确认</div>
    @endif

</div>
    <script type="text/javascript">
        $("#bind").on('click', function () {
            $.ajax({
                url:'/h5/kefu/bindkefu',
                data:{shop_id:'{{$shop_id}}'},
                success:function (response) {
                    if (response.errcode){
                        DSXUI.showToast(response.errmsg);
                    } else {
                        DSXUtil.reFresh();
                    }
                },
                complement:function(xhr){
                    alert(xhr);
                }
            });
        });
    </script>
@stop
